package com.example.wangzh.mytest;


import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;

import com.example.wangzh.mytest.base.BaseActivity;
import com.example.wangzh.mytest.databinding.ActivityMainBinding;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wangzh on 2017/10/25.
 */

public class MainActivity extends BaseActivity<ActivityMainBinding> {

    @Override
    protected void initView() {
        setSupportActionBar(mBinding.toolBar);
        final List<String> strs = new ArrayList<>();
        strs.add("权限申请");
        strs.add("路径动画");
        strs.add("大屏适配");
        strs.add("WIFI测试");
        strs.add("AI测试");
        strs.add("Reingold-Tifold算法");
        strs.add("Walker算法");
        strs.add("Buchheim算法");
        mBinding.grv.setAdapter(new ArrayAdapter<String>(this, R.layout.grid_item_text, strs));
        mBinding.grv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent intent;
                switch (strs.get(position)) {
                    case "权限申请":
                        intent = new Intent(MainActivity.this, PermissionTestActivity.class);
                        startActivity(intent);
                        break;
                    case "路径动画":
                        intent = new Intent(MainActivity.this, PathAnimatorActivity.class);
                        startActivity(intent);
                        break;
                    case "大屏适配":
                        intent = new Intent(MainActivity.this, BigScreenAdaptActivity.class);
                        startActivity(intent);
                        break;
                    case "WIFI测试":
                        intent = new Intent(MainActivity.this, WifiTestActivity.class);
                        startActivity(intent);
                        break;
                    case "AI测试":
                        intent = new Intent(MainActivity.this, AITestActivity.class);
                        startActivity(intent);
                        break;
                    case "Reingold-Tifold算法":
                        intent = new Intent(MainActivity.this, ReingoldTifoldTestActivity.class);
                        startActivity(intent);
                        break;
                    case "Walker算法":
                        intent = new Intent(MainActivity.this, WalkerAlgorithmTestActivity.class);
                        startActivity(intent);
                        break;
                    case "Buchheim算法":
                        intent = new Intent(MainActivity.this, BuchheimAlgorithmTestActivity.class);
                        startActivity(intent);
                        break;
                    default:
                        break;
                }
            }
        });
    }

}